package com.jintian.smart.oa.mapper;

import com.jintian.smart.kernel.orm.mapper.IBaseExtMapper;
import com.jintian.smart.base.api.oa.entity.EnterpriseEmployeeEntity;
import com.jintian.smart.base.api.oa.form.EnterpriseEmployeeQueryForm;
import com.jintian.smart.base.api.oa.view.EnterpriseEmployeeVO;
import org.beetl.sql.core.page.PageResult;
import org.beetl.sql.mapper.annotation.Mapper;
import org.beetl.sql.mapper.annotation.Param;
import org.beetl.sql.mapper.annotation.SqlResource;

import java.util.Collection;
import java.util.List;

/**
 * 企业员工
 */
@Mapper
@SqlResource("oa.EnterpriseEmployee")
public interface EnterpriseEmployeeMapper extends IBaseExtMapper<EnterpriseEmployeeEntity> {
    /**
     * 根据员工查询
     */
    List<EnterpriseEmployeeVO> selectByEmployeeIdList(@Param("employeeIdList") Collection<Long> employeeIdList);

    /**
     * 查询员工关联的企业
     */
    List<Long> selectEnterpriseIdByEmployeeId(@Param("employeeId") Long employeeId);

    /**
     * 根据企业查询
     */
    List<EnterpriseEmployeeVO> selectByEnterpriseIdList(@Param("enterpriseIdList") Collection<Long> enterpriseIdList);

    /**
     * 根据企业查询
     */
    List<EnterpriseEmployeeEntity> selectByEnterpriseId(@Param("enterpriseId") Long enterpriseId);

    /**
     * 查询企业下的所有员工id
     */
    List<Long> selectEmployeeIdByEnterpriseIdList(@Param("enterpriseIdList") Collection<Long> enterpriseIdList);

    /**
     * 根据员工删除
     */
    void deleteByEnterpriseAndEmployeeIdList(@Param("enterpriseId") Long enterpriseId, @Param("employeeIdList") Collection<Long> employeeIdList);

    /**
     * 根据员工查询
     */
    List<EnterpriseEmployeeEntity> selectByEnterpriseAndEmployeeIdList(@Param("enterpriseId") Long enterpriseId, @Param("employeeIdList") Collection<Long> employeeIdList);

    /**
     * 删除某员工关联的所有企业
     */
    void deleteByEmployeeId(@Param("employeeId") Long employeeId);

    /**
     * 分页查询企业员工
     */
    PageResult<EnterpriseEmployeeVO> queryPageEmployeeList(EnterpriseEmployeeQueryForm queryForm);
}
